//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    kinds: app.globalData.kinds,
    userInfo: {}
  },
  showOne: function() {
    wx.showToast({
      title: '敬请期待',
      icon: 'success',
      duration: 1000
    })
  },
  onShow: function() {
    let that = this;
    app.checkUserInfo(function(userInfo, isLogin) {
      if (isLogin) {
        that.setData({
           userInfo: userInfo
         });
      }else{
        that.setData({
          userInfo: {
            avatarUrl:'https://fublog.oss-cn-shenzhen.aliyuncs.com/logo.jpg',
            nickName:'欢迎大神光临'}
        });
      }
      // if (!isLogin) {
      //   wx.navigateTo({
      //     url: '../authorization/authorization?backType=mine'
      //   })
      // }else{
      //   that.setData({
      //     userInfo: userInfo
      //   });
      // }
    });
  }
})